package com.shopping.mall.core.module.goodsSpecification.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.sql.Timestamp;

/**
 * NumPrice实体类
 *
 * @author zzy
 * @date 2021-08-29
 */
@Data
@TableName("num_price")
public class NumPrice {

    public interface insert {
    }

    public interface update {
    }

    @ApiModelProperty(value = "价格表id")
    @TableId(type = IdType.UUID)
    private String id;

    @ApiModelProperty(value = "规格id")
    private String specificationId;

    @ApiModelProperty(value = "购买的数量")
    @Min(value = 2, message = "最少购买两个")
    private Integer number;

    @ApiModelProperty(value = "实际价格")
    @Min(value = 0, message = "不能低于0")
    private Double realPrice;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp createAt;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp updateAt;

}
